package com.techstar.ats;

import java.time.*;
import java.util.Date;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2WebMvc;

@Configuration
@EnableSwagger2WebMvc
public class SwaggerConfiguration {

	@Bean
	public Docket apiDocker() {
		return new Docket(DocumentationType.SWAGGER_2)
			.directModelSubstitute(Instant.class, Date.class)
			.directModelSubstitute(LocalDateTime.class, Date.class)
			.directModelSubstitute(LocalDate.class, String.class)
			.directModelSubstitute(LocalTime.class, String.class)
			.directModelSubstitute(YearMonth.class, String.class)
			.directModelSubstitute(MonthDay.class, String.class)
			.directModelSubstitute(Period.class, String.class);
	}
}
